package model

/*
	角色信息表
*/
type Role struct {
	BaseHeaderModel
	Pid    int64  `gorm:"default:0;comment:上级id"`
	Name   string `gorm:"type:varchar(32);not null;comment:角色名称"`
	Sorts  int64  `gorm:"type:tinyint(4);default:0;comment:排序"`
	Status int64  `gorm:"default:1;comment:角色状态1可用2不用"`
	BaseFooterModel
}

/*
	角色权限关联表
*/
type RoleUserAuth struct {
	BaseHeaderModel
	RoleId int64 `gorm:"default:0;comment:角色ID"`
	Type   int64 `gorm:"type:tinyint(2);default:1;comment:关联类型 1 角色 2 用户"`
	AuthId int64 `gorm:"default:0;comment:权限Id"`
	BaseFooterModel
}

func (u *Role) TableName() string {
	return "admin_role"
}

func (u *RoleUserAuth) TableName() string {
	return "admin_role_user_auth"
}
